﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace zUpLoad.Common
{
    class handleSQL
    {
        private static SqlConnection cn = null;
        public static SqlConnection getConnect()
        {
            if (handleSQL.cn == null || handleSQL.cn.State == ConnectionState.Closed)
            {
                handleSQL.cn = new SqlConnection();
                handleSQL.cn.ConnectionString = cSysStart.cConnstr;
                handleSQL.cn.Open();
            }
            return handleSQL.cn;
 
        }

        public static void closeConnect()
        {
            if (handleSQL.cn != null && handleSQL.cn.State == ConnectionState.Open)
            {
                handleSQL.cn.Close();
            }
        }


    }
}

